<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>用户登录页</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    html {
      height: 100%;
    }

    body {
      height: 100%;
      font-family: JetBrains Mono Medium;
      display: flex;
      align-items: center;
      justify-content: center;
      background: url("https://tse1-mm.cn.bing.net/th/id/R-C.0447794b870839e842a844362adf0cfd?rik=eDGgWJLSPozhyw&riu=http%3a%2f%2fseopic.699pic.com%2fphoto%2f50048%2f0632.jpg_wh1200.jpg&ehk=nFj2CvhKsG%2fH13u53zEUXquip2XPEfEseCXQBHx0jro%3d&risl=&pid=ImgRaw&r=0") center;
      background-size: 100% auto;
    }

    .form-wrapper {
      width: 300px;
      background-color: rgba(41, 45, 62, .8);
      color: #fff;
      border-radius: 2px;
      padding: 50px;
    }

    .form-wrapper .header {
      text-align: center;
      font-size: 35px;
      text-transform: uppercase;
      line-height: 100px;
    }

    .form-wrapper .input-wrapper input {
      background-color: rgb(41, 45, 62);
      border: 0;
      width: 100%;
      text-align: center;
      font-size: 15px;
      color: #fff;
      outline: none;
    }

    .form-wrapper .input-wrapper input::placeholder {
      text-transform: uppercase;
    }

    .form-wrapper .input-wrapper .border-wrapper {
      background-image: linear-gradient(to right, #e8198b, #0eb4dd);
      width: 100%;
      height: 50px;
      margin-bottom: 20px;
      border-radius: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .form-wrapper .input-wrapper .border-wrapper .border-item {
      height: calc(100% - 4px);
      width: calc(100% - 4px);
      border-radius: 30px;
    }

    .form-wrapper .action {
      display: flex;
      justify-content: center;
    }

    .form-wrapper .action .btn {
      border: 0; /* 取消按钮的边界 */
      width: 150px; /* 设置合适的按钮的长和宽 */
      height: 30px;
      margin-top: 18px; /* 设置合适的上部外框的宽度，增加与上面的password框的距离 */
      font-size: 18px; /* 修改按钮文字的大小 */
      color: white; /* 修改按钮上文字的颜色 */
      border-radius: 25px; /* 将按钮的左右边框设置为圆弧 */
      background-image: linear-gradient(to right, #00dbde 0%, #fc00ff 100%); /* 为按钮增加渐变颜色 */
    }



  </style>


  <link rel="stylesheet" href="/css/bootstrap-theme.min.css">
  <script src="/js/jquery-3.6.0.min.js"></script>
  <script src="/js/bootstrap.min.js"></script>

  <link rel="stylesheet" href="/plugins/bootstraptable/bootstrap-table.min.css">

</head>
<body>
<div class="form-wrapper">
  <div class="header">LOGIN</div>
  <div class="input-wrapper">

    <form>
      <div class="border-wrapper">
        <label for="username"></label>
        <input type="text" class="border-item" id="username" name="username" placeholder="用户名">
      </div>
      <div class="border-wrapper">
        <label for="password"></label>
        <input type="password" class="border-item" id="password" name="password" placeholder="密码">
      </div>

      <div class="action">
        <!--     点击登陆调用 login()方法     -->
        <button type="button" class="btn" id="button" onclick="login();">登录</button>
      </div>

    </form>

  </div>
</div>

</body>
<div class="container-fluid">


  <script type="text/javascript">


    function login(){

      var name=$("#username").val();// 取值
      var password=$("#password").val();

      $.ajax({

        url:"/api/login/user",
        data:{
          username:name,
          password:password
        }

      }).done(function (rs){

        if(rs>=0){
          //成功

          self.location.href="/transit/transit";
        }else {
          alert("用户名或密码出错！")
        }

      });
    }

  </script>
</div>
</html>